package cn.kgc.service.impl;

import cn.kgc.entity.Users;
import cn.kgc.mapper.UserMapper;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 东海龙王
 * @version 1.0
 * @date 2023/3/2 - 18:59
 */
@Service
public class UserDetailServiceImpl implements UserDetailsService {
    @Resource
    private UserMapper userMapper;


    @Override
    public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException {
        Users userByName = userMapper.getUserByName(userName);
        return userByName;
    }
}
